<include file="Public/head"/>
<link href="__PUBLIC__/layui/css/layui.css" rel="stylesheet" type="text/css" />
<body class="no-skin">
<include file="Public/header"/>
<div class="main-container" id="main-container">
<style>
table th{
    font-size: 18px;
    color:#000;
}
table td{
    font-size: 15px;
    /*color:#000;*/
}
.ul li{
    float: left;
    margin:10px 50px;
}


</style>
    <script type="text/javascript">
        try {
            ace.settings.check('main-container', 'fixed')
        } catch (e) {
        }
    </script>

    <include file="Public/sidebar"/>
    <div class="main-content">
        <div class="main-content-inner">
            <!-- #section:basics/content.breadcrumbs -->
            <include file="Public/breadcrumbs"/>

            <!-- /section:basics/content.breadcrumbs -->
            <div class="page-content">
                <include file="Public/set"/>
                    <div class="row">
                    <div class="col-xs-12">
                    
                    <?php if($guan == '1'): ?>
                         <ul class="ul">          
                            <li><button class="layui-btn layui-btn-big layui-btn-danger">删除</button></li>
                            <li><button class="layui-btn layui-btn-big layui-btn-normal" onclick="fu()">绩效辅导表创建</button></li>
                            <li><button class="layui-btn layui-btn-big layui-btn-normal" onclick="mian()">绩效面谈表创建</button></li>
                            <li><button class="layui-btn layui-btn-big layui-btn-normal" onclick="zhou()">绩效周分享表创建</button></li>
                        </ul>
                    <?php endif ?>

                        <div style="margin-top:5%;"></div>
                        <table class="table table-bordered" >
                            <thead>
                                <tr>
                                    <th class="center">序号</th>
                                    <th class="center">考核人</th>
                                    <th class="center">所属部门</th>
                                    <th class="center">所属岗位</th>
                                    <th class="center">表格类型</th>
                                    <th class="center">绩效月</th>
                                    <th class="center">表格状态</th>
                                    <th class="center">操作</th>
                                </tr>
                            </thead>
                            <tbody>
                              <?php if($empty == '1'): ?>
                                    <tr>
                                        <td colspan="8" class="center"><h2 style="font-size:45px;"> 暂无信息</h2></td>

                                    </tr>
                                <?php else: ?>
                                         <volist name="flist" id="vat">
                                                <tr>
                                                    <td class="center">{$vat.id}</td>
                                                    <td class="center">{$vat.uname}</td>
                                                    <td class="center">{$vat.ment}</td>
                                                    <td class="center">{$vat.post}</td>
                                                    <?php if($vat['type'] == '绩效辅导表'): ?>
                                                        <td class="center" style="color:#f08300;font-size:17px;">{$vat.type}</td>
                                                    <?php else: ?>
                                                        <?php if($vat['type'] == '绩效面谈表'): ?>
                                                            <td class="center" style="color:#00a3af;font-size:17px;">{$vat.type}</td>
                                                        <?php else: ?>
                                                            <?php if($vat['type'] == '绩效周分享表'): ?>
                                                                <td class="center" style="color:#47885e;font-size:17px;">{$vat.type}</td>
                                                            <?php endif ?>
                                                        <?php endif ?>
                                                    <?php endif ?>
                                                    <td class="center">{$nian}-{$vat.yue}月</td>
                                                    <?php if($vat['off'] == 0): ?>
                                                        <td class="center">未填写</td>
                                                        <td class="center"><button onclick="fut({$vat.id},this)" class="layui-btn layui-btn-danger layui-btn-radius" style="font-size:15px;">填写</button></td>
                                                    <?php else: ?>
                                                        <td class="center" style="color:#00a497"><b>√已填写</b></td>
                                                        <td class="center"><button class="layui-btn layui-btn-radius" style="font-size:15px;">提交</button></td>
                                                    <?php endif ?>
                                                    <!-- <td class="center">{$vat.post}</td> -->
                                                    
                                                    

                                                   
                                                    
                                                   
                                                </tr>  
                                            </volist>
                                <?php endif ?>
                            </tbody>
                        </table>
                        <!-- </form> -->


                    </div>
                    </div>
                    
            </div><!-- /.page-content -->
        </div>
    </div><!-- /.main-content -->
    <include file="Public/footer"/>

</div><!-- /.main-container -->

<include file="Public/footerjs"/>
<!-- inline scripts related to this page -->
<script src="__PUBLIC__/qwadmin/js/date-time/bootstrap-datepicker.js"></script>
<script src="__PUBLIC__/qwadmin/js/function.js"></script>
<script src="__PUBLIC__/layer/layer.js"></script>
<script type="text/javascript">

function fu()
{
     layer.open({
        type: 1,
        title:  ['创建绩效辅导表', 'font-size:17px;'],
        skin: 'demo-class', //加上边框
        area: ['330px', '350px'], //宽高
        content: $('#fu'),
        // btn:'按钮'
    });
}
function mian()
{
     layer.open({
        type: 1,
        title:  ['创建绩效面谈表', 'font-size:17px;'],
        skin: 'demo-class', //加上边框
        area: ['330px', '350px'], //宽高
        content: $('#mian'),
        // btn:'按钮'
    });
}
function zhou()
{
     layer.open({
        type: 1,
        title:  ['创建绩效周分享表', 'font-size:17px;'],
        skin: 'demo-class', //加上边框
        area: ['330px', '350px'], //宽高
        content: $('#zhou'),
        // btn:'按钮'
    });
}

//创建绩效辅导表
function fti()
{
    //询问框
    layer.confirm('确定选择么 ( ・◇・)？', {
      btn: ['确定','取消'] //按钮
    }, function(){
         $.ajax({
             type: "POST",
             url:"{:U('xuan')}",
             data:$('#formf').serialize(),// 要提交的表单 
             beforeSend:function(){
                   layer.load(0, {shade: false});
                },
             success: function(msg) {
                // console.log(msg);
                if (msg == 1111) {
                    layer.msg('添加成功~', {icon: 1});
                    history.go(0); 
                }else{
                    if (msg == '请不要重复创建') {
                        layer.msg('请不要重复添加', {icon: 2});
                    }else{
                        layer.msg('添加失败！', {icon: 2});
                    }
                }
             },
             complete: function() {
                     layer.closeAll('loading');
                }
         });
     
    }, function(){
        layer.msg(' (｡・`ω´･) 再见');
    });   
}

//填写绩效辅导表
function fut(id,obj)
{
    var type = $(obj).parent().prev().prev().prev().text();
    // console.log(type);
    location.href="{:U('Team/fu')}"+'?id='+id+'&type='+type;  
}







//创建绩效辅导表
function mti()
{
    //询问框
    layer.confirm('确定选择么 ( ・◇・)？', {
      btn: ['确定','取消'] //按钮
    }, function(){
         $.ajax({
             type: "POST",
             url:"{:U('xuan')}",
             data:$('#formm').serialize(),// 要提交的表单 
             beforeSend:function(){
                   layer.load(0, {shade: false});
                },
             success: function(msg) {
                // console.log(msg);
                if (msg == 1111) {
                    layer.msg('添加成功~', {icon: 1});
                    history.go(0); 
                }else{
                    if (msg == '请不要重复创建') {
                        layer.msg('请不要重复添加', {icon: 2});
                    }else{
                        layer.msg('添加失败！', {icon: 2});
                    }
                }
             },
             complete: function() {
                     layer.closeAll('loading');
                }
         });
     
    }, function(){
        layer.msg(' (｡・`ω´･) 再见');
    });   
}


//创建绩效辅导表
function zti()
{
    //询问框
    layer.confirm('确定选择么 ( ・◇・)？', {
      btn: ['确定','取消'] //按钮
    }, function(){
         $.ajax({
             type: "POST",
             url:"{:U('xuan')}",
             data:$('#formz').serialize(),// 要提交的表单 
             beforeSend:function(){
                   layer.load(0, {shade: false});
                },
             success: function(msg) {
                // console.log(msg);
                if (msg == 1111) {
                    layer.msg('添加成功~', {icon: 1});
                    history.go(0); 
                }else{
                    if (msg == '请不要重复创建') {
                        layer.msg('请不要重复添加', {icon: 2});
                    }else{
                        layer.msg('添加失败！', {icon: 2});
                    }
                }
             },
             complete: function() {
                     layer.closeAll('loading');
                }
         });
     
    }, function(){
        layer.msg(' (｡・`ω´･) 再见');
    });   
}





</script>
</body>
</html>

    <div id="fu" class="row" style="display:none;width:100%;"> 
        <form  style="margin-left:20%;" id="formf" >
        <input type="hidden" name="type" value="1">
        <div class="form-group">
            <label for="exampleInputEmail1" style="margin-top:10px;">考核人:</label>
            <select class="form-control" name="uname" style="width:200px;text-align:center;">
                <volist name="list" id="v">
                        <option value="{$v.user}">{$v.user}</option>
                        
                </volist>
            </select>
        </div>
        <br>
        <div class="form-group">
            <label for="exampleInputEmail1" style="margin-top:10px;">绩效月:</label><br>
            <input type="date" name="j_time" style="width:200px;">
        </div>

        <!-- <input  type="file" name="file" /> -->
                        
        <div type="submit" onclick="fti()" class="layui-btn layui-btn-danger layui-btn-radius" style="margin-left:20%;margin-top:10px;">确定创建</div>


        </form>


    </div>


    <div id="mian" class="row" style="display:none;width:100%;"> 
        <form  style="margin-left:20%;" id="formm">
        <input type="hidden" name="type" value="2">
        <div class="form-group">
            <label for="exampleInputEmail1" style="margin-top:10px;">考核人:</label>
            <select class="form-control" name="uname" style="width:200px;text-align:center;">
                <volist name="list" id="v">
                        <option value="{$v.user}">{$v.user}</option>
                        <!-- <input type="hidden" name="uid" value="{$v.uid}"> -->
                </volist>
            </select>
        </div>
        <br>
        <div class="form-group">
            <label for="exampleInputEmail1" style="margin-top:10px;">绩效月:</label><br>
            <input type="date" name="j_time" style="width:200px;">
        </div>

        <!-- <input  type="file" name="file" /> -->
                        
        <div type="submit" onclick="mti()" class="layui-btn layui-btn-danger layui-btn-radius" style="margin-left:20%;margin-top:10px;">确定创建</div>


        </form>


    </div>



    <div id="zhou" class="row" style="display:none;width:100%;"> 
        <form  style="margin-left:20%;" id="formz">
        <input type="hidden" name="type" value="3">
        <div class="form-group">
            <label for="exampleInputEmail1" style="margin-top:10px;">考核人:</label>
            <select class="form-control" name="uname" style="width:200px;text-align:center;">
                <volist name="list" id="v">
                        <option value="{$v.user}">{$v.user}</option>
                        <!-- <input type="hidden" name="uid" value="{$v.uid}"> -->
                </volist>
            </select>
        </div>
        <br>
        <div class="form-group">
            <label for="exampleInputEmail1" style="margin-top:10px;">绩效月:</label><br>
            <input type="date" name="j_time" style="width:200px;">
        </div>

        <!-- <input  type="file" name="file" /> -->
                        
        <div type="submit" onclick="zti()" class="layui-btn layui-btn-danger layui-btn-radius" style="margin-left:20%;margin-top:10px;">确定创建</div>


        </form>


    </div>